import 'package:flutter/material.dart';
import 'package:flutter_widget/src/config/color_define.dart';

import '../../config/assets.dart';

/*空白页面*/
class PageViewEmptyWidget extends StatelessWidget {
  final String? icon;
  final String? text;
  final double? textFontSize;
  final Widget? bottomWidget;

  const PageViewEmptyWidget({
    Key? key,
    this.icon,
    this.text,
    this.textFontSize,
    this.bottomWidget,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Expanded(
          child: Container(
            alignment: Alignment.bottomCenter,
            child: icon?.isNotEmpty == true
                ? Image.asset(
                    icon!,
                  )
                : FWAssets.emptyIcon,
          ),
        ),
        Expanded(
          child: Container(
            alignment: Alignment.topCenter,
            padding: const EdgeInsets.fromLTRB(0, 12, 0, 0),
            child: Text(
              text ?? '暂无内容',
              style: TextStyle(
                  color: FWColorPicker.textFFAAAAAA,
                  fontSize: textFontSize ?? 14),
            ),
          ),
        ),
        if (bottomWidget != null) bottomWidget!,
      ],
    );
  }
}
